import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeNav from "@/views/HomeNav";


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeNav,
    redirect: '/community',
    children: [
      {
        path: '/community',
        name: 'CommunityManagement',
        component: () => import('../components/CommunityManagement')
      },
      {
        path: '/bangmai/store',
        name: 'StoreManagement',
        component: () => import('../components/bangmai/StoreManagement')
      },
      {
        path: '/bangmai/store/storeAdministration',
        name: 'StoreAdministration',
        component: () => import('../components/bangmai/StoreAdministration')
      },
      {
        path: '/bangmai/station',
        name: 'StationManagement',
        component: () => import('../components/bangmai/StationManagement')
      },
      {
        path: '/bangmai/product',
        name: 'ProductManagement',
        component: () => import('../components/bangmai/ProductManagement')
      },
      {
        path: '/bangmai/order',
        name: 'OrderManagement',
        component: () => import('../components/bangmai/OrderManagement'),
          redirect: '/bangmai/order',
          children: [
              {
                  path: '',
                  name: 'OrderHelpMeBuy',
                  component: () => import('../components/bangmai/order/OrderHelpMeBuy'),
              },
              {
                  path: 'helpmetake',
                  name: 'OrderHelpMeTake',
                  component: () => import('../components/bangmai/order/OrderHelpMeTake'),
              },
              {
                  path: 'helpmegive',
                  name: 'OrderHelpMeGive',
                  component: () => import('../components/bangmai/order/OrderHelpMeGive'),
              },
          ]
      },
      {
        path: '/bangmai/waste',
        name: 'WasteRecycling',
        component: () => import('../components/bangmai/WasteRecycling')
      },
      {
        path: '/zhengxuan/order',
        name: 'OrderManage',
        component: () => import('../components/zhengxuan/OrderManage')
      },
      {
        path: '/zhengxuan/product',
        name: 'productManage',
        component: () => import('../components/zhengxuan/ProductManage')
      },
      {
        path: '/zhengxuan/sales',
        name: 'SalesOrder',
        component: () => import('../components/zhengxuan/SalesOrder')
      },
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
